/**
 * Project Name:mauto-web
 * File Name:AreaService.java
 * Package Name:com.inftech.mauto.sys.service
 * Date:2016年10月7日下午9:14:13
 * Copyright (c) 2016, inf-technology Co., Ltd. All Rights Reserved.
 *
*/

package com.inftech.mauto.core.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.inftech.mauto.common.utils.CommonUtils;
import com.inftech.mauto.core.dao.IFeedbackDao;
import com.inftech.mauto.core.entity.Feedback;
import com.mingsoft.base.biz.impl.BaseBizImpl;
import com.mingsoft.base.dao.IBaseDao;

/**
 * 
 * ClassName: FeedbackService <br/>
 * Function: 反馈service. <br/>
 * date: 2016年11月6日 下午10:24:00 <br/>
 *
 * @author puyf
 * @version
 * @since JDK 1.7
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Service("feedbackService")
public class FeedbackService extends BaseBizImpl {

	/**
	 * 反馈持久化层注入
	 */
	@Autowired
	private IFeedbackDao feedbackDao;

	@Override
	protected IBaseDao getDao() {
		return feedbackDao;
	}

	/**
	 * 
	 * saveFeedback:新增反馈. <br/>
	 *
	 * @author puyf
	 * @param feedback
	 * @throws Exception
	 * @since JDK 1.7
	 */
	public int saveFeedback(Feedback feedback) throws Exception {
		Date now = CommonUtils.getNowD();
		// 插入反馈表
		feedback.setFeedbackTime(now);
		feedback.setCreateBy(feedback.getPeopleId());
		feedback.setCreateDate(now);
		feedback.setUpdateDate(now);
		feedback.setDelFlag(0);
		int result = feedbackDao.saveEntity(feedback);
		return result;
	}

	/**
	 * 
	 * queryFeedbackList:后台查询反馈列表. <br/>
	 *
	 * @author puyf
	 * @param paramMap
	 * @return
	 * @throws Exception
	 * @since JDK 1.7
	 */
	public List<Feedback> queryFeedbackList(Map<String, Object> paramMap) throws Exception {
		// 获取反馈列表
		List<Feedback> feedbackList = feedbackDao.queryFeedbackList(paramMap);
		return feedbackList;

	}
}
